﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Cryptography;
using System.Text;

namespace ESAM_Assignment_3
{
    public class Encryption
    {
        public static string shaEncrypt(string data) 
        {
            SHA1 s = SHA1.Create();
            StringBuilder sb = new StringBuilder();
            byte[] hashpw = Encoding.Default.GetBytes(data);

            hashpw = s.ComputeHash(hashpw);

            foreach (byte b in hashpw)
            {
                sb.Append(b.ToString("x2"));
            }

            string password = sb.ToString();

            return password;
        }

      
    }
}